<%-- 
    Document   : MarksReport
    Created on : May 6, 2014, 10:07:15 AM
    Author     : Mukesh
--%>
<%
    try {
        if (session.getAttribute("uid") != null) {
            if (session.getAttribute("Manage_Examination").toString().equals("1")) {
%>
<%@page import="Course.CourseBean"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Vector"%>
<%String to = "", status = "", msg = "", admissionId = "";%>
<%if (request.getParameter("admissionId") != null) {
        admissionId = request.getParameter("admissionId");
    }%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Ramgovind Automated System</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="/RIT/css/bootstrap.css">
        <link rel="stylesheet" href="/RIT/css/bootstrap-responsive.css">
        <link rel="stylesheet" href="/RIT/css/jquery.fancybox.css">
        <link rel="stylesheet" href="/RIT/css/uniform.default.css">
        <link rel="stylesheet" href="/RIT/css/bootstrap.datepicker.css">
        <link rel="stylesheet" href="/RIT/css/jquery.cleditor.css">
        <link rel="stylesheet" href="/RIT/css/jquery.plupload.queue.css">
        <link rel="stylesheet" href="/RIT/css/jquery.tagsinput.css">
        <link rel="stylesheet" href="/RIT/css/jquery.ui.plupload.css">
        <link rel="stylesheet" href="/RIT/js/tableTools/css/TableTools.css">
        <link rel="stylesheet" href="/RIT/css/chosen.css">
        <link rel="stylesheet" href="/RIT/css/chosen.css">
        <link rel="stylesheet" href="/RIT/css/style.css">
        <link rel="stylesheet" href="/RIT/css/iconfont.css">
        <link rel="stylesheet" href="/RIT/css/lightBox.css">

        <script src="../../ajax/ajax.js"></script>
        <script type="text/javascript">
            function loadReport()
            {
                var stream = document.getElementById('stream').value;
                var sem = document.getElementById('semester').value;
                document.getElementById('ILoader').setAttribute("style", "visibility: visible;width: 250px;height: 250px;position: absolute;top: 50%;left:50%;margin-top: -80px;margin-left: -40px;background:url(/RIT/img/loader.gif) no-repeat;z-index: 667999;background-size:200px 200px;");

                var xmlhttp;
                if (window.XMLHttpRequest)
                {
                    xmlhttp = new XMLHttpRequest();
                }
                else
                {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function()
                {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
                    {
                        document.getElementById('tbody').innerHTML = xmlhttp.responseText;
                        document.getElementById('ILoader').removeAttribute("style");
                    }
                }
                xmlhttp.open("POST", "/RIT/GetMarksReport?stream=" + stream + "&semester=" + sem, true);
                xmlhttp.send();
            }
//----------------------------------------------------------
            function viewAgentDetails(admissionid,rollno,stuname)
            {
                var stream=document.getElementById('stream').options[document.getElementById('stream').selectedIndex].text;
                var sem=document.getElementById('semester').value;
                document.getElementById('ILoader').setAttribute("style", "visibility: visible;width: 250px;height: 250px;position: absolute;top: 50%;left:50%;margin-top: -80px;margin-left: -40px;background:url(/TULSI/img/loader.gif) no-repeat;z-index: 667999;background-size:200px 200px;");
                var xmlhttp;
                if (window.XMLHttpRequest)
                {
                    xmlhttp = new XMLHttpRequest();
                }
                else
                {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function()
                {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
                    {
                        document.getElementById('ILoader').removeAttribute("style");
                        document.getElementById("detailDiv").innerHTML = xmlhttp.responseText;
                        $("#detailDiv").fadeIn(1000);

                    }
                }
                //xmlhttp.open("POST","/BASIL/AgentNameServlet?code="+code+"&bcode="+bcode,true);
                xmlhttp.open("POST", "/RIT/GetMarksReportDetail?id="+admissionid+"&rollno="+rollno+"&stuname="+stuname+"&stream="+stream+"&sem="+sem, true);
                xmlhttp.send();
            }

            function quickClose() {
                $("#detailDiv").fadeOut(500);

            }
//----------------------------------------------------------
            /*function deleteEnquiry(i)
             {
             var xmlhttp;
             if (window.XMLHttpRequest)
             {
             xmlhttp = new XMLHttpRequest();
             }
             else
             {
             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
             }
             xmlhttp.onreadystatechange = function()
             {
             if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
             {
             
             var temp = xmlhttp.responseText;
             if (temp == 1)
             {
             var table = document.getElementById(i);
             for (var j = 5; j >= 0; j--)
             {
             table.deleteCell(j);
             }
             }
             else
             {
             alert("This Data is Used at Some Other Place");
             }
             }
             }
             xmlhttp.open("POST", "/RIT/DeleteAdmission?id=" + i, false);
             xmlhttp.send();
             }*/
        </script>
    </head>
    <body>					
        <div id="ILoader"></div>
        <div id="detailDiv" class='white_content'></div>
        <%@include file="/topheader.html" %>
        <%@include file="/servicesheader.html" %>
        <div class="main">
            <div class="container-fluid">
                <%@include file="/Services/Examination/examsidenav.html" %>
                <div class="content">
                    <%if (session.getAttribute("status") != null) {
                            status = session.getAttribute("status").toString();
                            msg = session.getAttribute("msg").toString();
                    %>
                    <div class="alert alert-info alert-block">
                        <a class="close" data-dismiss="alert" href="#"><img src="/RIT/img/mclose.png"></a>
                        <h4 class="alert-heading"> <%=status%></h4>
                        <%=msg%>

                    </div>
                    <%session.removeAttribute("status");
                            session.removeAttribute("msg");
                        }%>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="box">
                                <div class="box-head">
                                    <h3>Report Card</h3>
                                    <a href="AddNumber.jsp">
                                        <button style="float: right" class="btn btn-success">Add Marks</button>
                                    </a>
                                </div>
                                <form action="/RIT/AddMarks" method="post" class='validate form-horizontal'>
                                    <div class="box-content">
                                        <!---Form Start....-->
                                        <div style="margin-bottom: 10px">
                                            <select name="course" id="course" class='{required:true}'onchange="getStream('stream', this.value)">
                                                <option value=''>Select Course</option>
                                                <%
                                                    Vector<Object> list = Course.Query.viewAll();
                                                    Iterator it = list.iterator();
                                                    while (it.hasNext()) {
                                                        CourseBean cb = (CourseBean) it.next();
                                                %>
                                                <option value="<%=cb.getCourseName()%>"><%=cb.getCourseName()%></option>
                                                <%}%>
                                            </select>

                                            <select name="stream" id="stream" class='{required:true}' onchange="getSemester('course', this.options[this.selectedIndex].text)">
                                                <option value="">Select Stream</option>
                                            </select>
                                            <select name="semester" id="semester" class='{required:true}' >
                                                <option value="">Select Semester</option>
                                            </select>

                                            <input type="button" class="btn default" value='Get Report' onclick="loadReport()">
                                        </div>
                                        <div class="box-content box-nomargin">
                                            <table class='table table-striped dataTable-noheader dataTable-nofooter table-bordered' id="ct">
                                                <thead>
                                                    <tr>
                                                        <th>Name</th>
                                                        <th>Roll No.</th>
                                                        <th>#</th>
                                                    </tr>
                                                </thead>
                                                <tbody id="tbody">

                                                </tbody>
                                            </table>
                                        </div>           
                                        <!---Form Ends....-->
                                    </div>
                                    
                                </form>
                            </div>
                        </div>
                    </div>
                </div>	
            </div>
        </div>
    </div>	
    <script src="/RIT/js/jquery.js"></script>
    <script src="/RIT/js/less.js"></script>
    <script src="/RIT/js/bootstrap.min.js"></script>
    <script src="/RIT/js/jquery.uniform.min.js"></script>
    <script src="/RIT/js/bootstrap.timepicker.js"></script>
    <script src="/RIT/js/bootstrap.datepicker.js"></script>
    <script src="/RIT/js/chosen.jquery.min.js"></script>
    <script src="/RIT/js/jquery.fancybox.js"></script>
    <script src="/RIT/js/plupload/plupload.full.js"></script>
    <script src="/RIT/js/plupload/jquery.plupload.queue/jquery.plupload.queue.js"></script>
    <script src="/RIT/js/jquery.cleditor.min.js"></script>
    <script src="/RIT/js/jquery.inputmask.min.js"></script>
    <script src="/RIT/js/jquery.tagsinput.min.js"></script>
    <script src="/RIT/js/jquery.mousewheel.js"></script>
    <script src="/RIT/js/jquery.dataTables.min.js"></script>
    <script src="/RIT/js/jquery.dataTables.bootstrap.js"></script>
    <script src="/RIT/js/jquery.textareaCounter.plugin.js"></script>
    <script src="/RIT/js/ui.spinner.js"></script>
    <script src="/RIT/js/jquery.cookie.js"></script>
    <script src="/RIT/js/tableTools/js/TableTools.min.js"></script>
    <script src="/RIT/js/custom.js"></script><script src="js/demo.js"></script>
    <script src="/RIT/js/iconfont.js"></script>
    <style>
        b{color: rgb(26, 115, 212);}
    </style>
</body>

</html>

<%} else {
%>
<script type="text/javascript">
                                                        alert("You Are Not Authorised");
                                                        window.history.back();
</script>
<%             }
        } else {
            request.setAttribute("msg", "You Are Not Authorised! Please Contact to System Administrator!");
            request.setAttribute("value", "0");
            getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);
        }
    } catch (Exception e) {
        request.setAttribute("msg", "Please Contact to System Administrator!");
        request.setAttribute("value", "0");
        getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);
    }
%>

